package com.xmy.cultivate.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.cultivate.entity.views.*;
import com.xmy.cultivate.excel.ExcelEnrollRecord;
import org.apache.ibatis.annotations.Param;
import org.springframework.scheduling.annotation.Async;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 招生数据 服务类
 * </p>
 *
 * @author min
 * @since 2023-02-10
 */
public interface IEnrollInfoService extends IService<EnrollInfo> {

    public abstract List<EnrollInfo> getEnrollInfoList(String orderId);

    public abstract boolean addEnrollInfo(OrderApply orderApply);

    public abstract boolean delEnrollInfo(String id);

    EnrollInfo getGrantCount(Long orderId);

    public abstract IPage<EnrollDetail> getParticulars(IPage<?> page, Wrapper wrapper);

    IPage<EnrollGrantDetail> getParticularsGrantDetail(IPage<?> page, Wrapper wrapper);

    public abstract List<String> getEnrollTeacher(Long orderId, Integer type);

    public abstract IPage<EnrollRecord> getEnrollStudent(IPage<?> page, Wrapper wrapper);

    public abstract List<ExcelEnrollRecord> getExcelEnrollStudent(Wrapper wrapper);

    public abstract List<EnrollInfo> getListByTeacher(Wrapper wrapper);

    boolean updateIsTrue(Quarter quarterNow);

    public abstract IPage<EnrollSummary> getParticularsDataSummary(IPage<?> page, Wrapper wrapper);


    IPage<EnrollGrantOperate> getParticularsGrant(IPage<?> page, Wrapper wrapper, Integer showType);

    @Async("onlineAsync")
    void addEnrollStudentTranscript(Integer yearPart, Integer quarterNum, Long studentId);

    boolean addDataTranscript(Quarter quarter, Quarter lastQuarter, Long studentId, Long subjectsId);

    EnrollInfo getMinAndMaxDate(Long teamId, String startDate, String endDate);


    BigDecimal getParticularsTotal(Long schoolId,
                                   Long teacherId,
                                   String startDate,
                                   String endDate,
                                   String startTrueDate,
                                   String endTrueDate);

    Integer particulartsUpdate(Long schoolId,
                               Long teacherId,
                               String startDate,
                               String endDate,
                               String grantDate,
                               Long grantTime,
                               Long operateTeacherId,
                               String operateTeacherName,
                               String startTrueDate,
                               String endTrueDate,
                               Long grantNo

    );
}
